﻿using QLBH.DTO; 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace QLBH.DATA
{
    public class XemNhatKyData
    {
        private static QLBHEntities db = new QLBHEntities();
        public string Error { get; set; }
        public List<XEMNHATKYPARAM> XemNhatKyNhapXuat_Data(DateTime tu_ngay, DateTime den_ngay, int so_dong)
        {
            List<XEMNHATKYPARAM> list = new List<XEMNHATKYPARAM>();
            list = db.XEMNHATKY2(tu_ngay, den_ngay).Select(p => new XEMNHATKYPARAM()
            {
                ngay = p.NGAY_NHAP_XUAT,
                id_nhap = p.MA_PHIEU_NHAP_STRING,
                id_xuat = p.MA_PHIEU_XUAT_STRING
            }).ToList();
           // list = db.Database.SqlQuery<XEMNHATKYPARAM>("XEMNHATKY2 {0},{1}", tu_ngay.ToString(), den_ngay.ToString()).ToList<XEMNHATKYPARAM>();
            return list;
        }  
    }
}